package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;
//model layer package has to be imported
/**
 * Controller class for the DVD collection
 * 
 * @author (kbh) 
 * @version (2005.03.31)
 * @revised version English (Ab)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class DVDCtr
{
    //declare instance variables to reference containers
    private DVDCollection dvdCollection;
    private DVD dvd;
    //private ArrayList<Copy> copies;

    /**
     * Constructor for objects of class DVDCtr
     */
    public DVDCtr()
    {
        //DVDCopy = new Copy();
        //copies = new ArrayList<Copy>();
        //CopyContainer copyctr = new CopyContainer();
        //set up references to containers   
        dvdCollection = new DVDCollection();
        dvd = new DVD();
    }

    //Dummy implementation: after implementing the model layer 
    //objects of class DVD are to be returned, not String
    public DVD findDVD(String title)
    {
        //this method is to search the container for a DVD
        //with an id-number equal to the parameter no
        //when the dvd is found, the method is to call print-methods in the TUI layer

        return dvdCollection.findDVD(title);
    }

    //Dummy implementation: more parameters are probaly to added
    
    public void createDVD(int no, String title, String releaseDate)
    {       
          dvdCollection.createDVD(no, title, releaseDate);
    }

    public void deleteDVD(String t)
    {
        dvdCollection.removeDVD(t);
    }

    public void addCopy(String t, String serialNumber, String purchaseDate, String purchasePrice)
    {
        dvdCollection.addCopy(t, serialNumber, purchaseDate, purchasePrice);
    }
    
    public void listAllDVDs()
    {
          //returns a list of all dvds and their associated copies
          dvdCollection.listAllDVDs();
    }
    
    public void print(String t)
    {
        dvd.printInfo();
    }
    
    //public void updateDVD(String t, String title, String releaseDate)
   // {
   //     dvdCollection.updateDvd(t, title, releaseDate);
   // }
}
